package com.ruoyi.js.service.impl;

import java.util.List;
import com.ruoyi.framework.util.ShiroUtils;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.framework.util.ShiroUtils;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.js.mapper.JsScoreQueueMapper;
import com.ruoyi.js.domain.JsScoreQueue;
import com.ruoyi.js.service.IJsScoreQueueService;
import com.ruoyi.common.core.text.Convert;

/**
 * 打分队列Service业务层处理
 * 
 * @author greejoy
 * @date 2024-10-16
 */
@Service
public class JsScoreQueueServiceImpl implements IJsScoreQueueService 
{
    @Autowired
    private JsScoreQueueMapper jsScoreQueueMapper;

    /**
     * 查询打分队列
     * 
     * @param id 打分队列ID
     * @return 打分队列
     */
    @Override
    public JsScoreQueue selectJsScoreQueueById(Long id)
    {
        return jsScoreQueueMapper.selectJsScoreQueueById(id);
    }

    /**
     * 查询打分队列列表
     * 
     * @param jsScoreQueue 打分队列
     * @return 打分队列
     */
    @Override
    public List<JsScoreQueue> selectJsScoreQueueList(JsScoreQueue jsScoreQueue)
    {
        return jsScoreQueueMapper.selectJsScoreQueueList(jsScoreQueue);
    }

    /**
     * 新增打分队列
     * 
     * @param jsScoreQueue 打分队列
     * @return 结果
     */
    @Override
    public int insertJsScoreQueue(JsScoreQueue jsScoreQueue)
    {
        jsScoreQueue.setCreateBy(ShiroUtils.getLoginName());
        jsScoreQueue.setCreateTime(DateUtils.getNowDate());
        return jsScoreQueueMapper.insertJsScoreQueue(jsScoreQueue);
    }

    /**
     * 修改打分队列
     * 
     * @param jsScoreQueue 打分队列
     * @return 结果
     */
    @Override
    public int updateJsScoreQueue(JsScoreQueue jsScoreQueue)
    {
        jsScoreQueue.setUpdateBy(ShiroUtils.getLoginName());
        jsScoreQueue.setUpdateTime(DateUtils.getNowDate());
        return jsScoreQueueMapper.updateJsScoreQueue(jsScoreQueue);
    }

    /**
     * 删除打分队列对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteJsScoreQueueByIds(String ids)
    {
        return jsScoreQueueMapper.deleteJsScoreQueueByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除打分队列信息
     * 
     * @param id 打分队列ID
     * @return 结果
     */
    @Override
    public int deleteJsScoreQueueById(Long id)
    {
        return jsScoreQueueMapper.deleteJsScoreQueueById(id);
    }

    @Override
    public int deleteJsScoreQueueByRegisterId(Long registerId)
    {
        return jsScoreQueueMapper.deleteJsScoreQueueByRegisterId(registerId);
    }

    @Override
    public int deleteJsScoreQueueByJudgeId(Long judgeId)
    {
        return jsScoreQueueMapper.deleteJsScoreQueueByJudgeId(judgeId);
    }

    @Override
    public JsScoreQueue selectJsScoreQueueByJudgeId(Long judgeId)
    {
        return jsScoreQueueMapper.selectJsScoreQueueByJudgeId(judgeId);
    }
}
